﻿// See https://aka.ms/new-console-template for more information
using SqlSugar;

Console.WriteLine("Hello, World!");

//数据库链接字符串
string ConnectionString1 = "Data Source=127.0.0.1,1433;Initial Catalog=CARD3500;Persist Security Info=True;User ID=sa;Password=123";

ConnectionConfig config = new ConnectionConfig()
{
    ConnectionString = ConnectionString1,
    DbType = DbType.SqlServer,
    InitKeyType = InitKeyType.SystemTable
};
Console.WriteLine("开始连接数据库并，生成实体");
using (SqlSugarClient Client = new SqlSugarClient(config))
{
    //生成所有的表对应实体
    {
        Client.DbFirst.CreateClassFile(@"E:\项目\2021\FC8280T人脸机调试器\Card3500对接\Card3500.FC8280Module\Card3500.FC8280Module.Storage");
    }
    //{
    //    //条件筛选--生成实体
    //    Client.DbFirst.Where(c => c.StartsWith("Zhaoxi")).CreateClassFile(@"D:\ZXWork\Richard-Public\2021\2021ORM-SqlSugar\Advanced.Project\Advanced.SqlSugarDbFirst\DbModels");
    //}
}
Console.WriteLine("数据库实体，生成完毕，按任意键退出");
Console.ReadKey();